MV Share Store
===============

This a library used to Store, Save, Send and Share Data in a flexible and reliable manner using memory mapped files.

It will consist of:
	
	MVShareStore		-	A Library that implements the data storage, saving, sharing and sending of user supplied data.
	MVDataServer		-	A Windows Application used to collect the data to Store, Save, Send to the Client or Share with the Client.
	MVDataClient		-	The Client recipient of the data Sent or Shared by the Server.
	MVDataTester		-	A simple app used to test various disparate data handling capabilities (not for release).
	MVConfigHandler	-	An MVConfig File Handling Client application.

Functions:

	Data Pack		-	Package up multiple Data Items in Packs of Data. Data Packs may also be Data Items.
	Data Share		-	Make the data supplied available to any Client application that needs to use it using Memory Mapped Files.
	Data Store		-	Store the data supplied to files on disk for later retrieval (can this be done directly from the memory mapped files?).
	Data Send		-	Send the data supplied to a particular Client program (not yet implemented).

How it works:

	Each request for a new DataShare will optionally include the name, if it is private, the owner (and password when I have figured out how to make this secure).
	If successful the DataShare numeric ID will be returned (-1 if not successful).
	Each Data Share Header will be stored securely in a HeaderList global area.
	All DataStores will be able to be accessed using the ID or the Key.
	Headers stored in the Global Area will be read / write. The Data Stores themselves will be read only.
	Servers can be named enabling multiple servers to be able to be run concurrently on the same machine. If not the default / global name will be used.

ShareStore Classes:

	Data				-	The Class used to store and control access to the currently active DataPack, DataSHare etc. in the ShareStore. It will also maintain a list of all the DataShares that have been created. All functions and variables should be declared static.
	DataArea			-	The Class that handles all the data itself. It should handle any type of data and any amount of it. (It may need to be Serializable or it may need to be convertable to and from byte arrays (binary)).
	DataPack			-	The class that actually contains all the data in a DataShare but which can also be used independently for data storage and manipulation.
	DataShare		-	An individual store of data in a DataPack that can be posted into a ShareStore to be shared between processes.
	DataStore		-	Class used to save DataPacks and DataShares to disk for later retrieval and use.
	DataItem			-	Item containing the data items / variables to be stored in the Data Share.
	DataType			-	Used to define all the data types such as:DataType.Short, DataType.String etc.
	DataSend			-	The class that Sends DataPack instances to defined target Clients.
	Header			-	Used to define the header used for each DataShare Stored in a Memory Mapped file.
	ShareList		-	Used to maintain a list of all the DataShare Headers in the ShareStore.
	ShareMmf			-	Shared Area Memory Mapped File handling.
	ShareStore		-	The Class that defines a (named) global memory area that contains the DataShares. Multiple ShareStores on the same machine are allowed as long as they have different names.
	Index				-	An Index into all the DataItems in the Data instance defined in an array (or two).
	Global			-	The Class that implements a global memory mapped area used to connect Clients to Shared data.
	GlobalMmf		-	Global Area Memory Mapped File handling.
	Settings			-	Settings handling.
	ConfigFile		-	A wrapper for the MVConfig Library MVConfigFile API and used to create, open and save as well as maintain them.
	ConfigData		-	A wrapper for the MVConfig Library MVConfigData API and used to store and maintain the Config File Entries.
	ConfigEntry		-	A wrapper for the MVConfig Library MVConfigEntry API and used to define entries in the Config File.

	Data Class supported data types (and names):

		bool (Bool)						-	bool value (True or False)
		byte (Byte)						-	byte (unsigned 8 bit integer) values = 0 - 255.
		char (Char)						-	char (16 bit) values = U+0000 to U+FFFF
		short (Short)					-	short (signed 16 bit integer) values = -32,768 to 32,767
		int (Int)						-	int (signed 32 bit integer) values = -2,147,483,648 to 2,147,483,647
		long (Long)						-	long (signed 64-bit integer) values = -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
		float (Float)					-	float (4 byte numeric) values = ~6-9 digits
		double (Double)				-	double (8 byte numeric) values = ~15-17 digits
		decimal (Decimal)				-	decimal (16 byte numeric) values = ~28-29 digits
		string (String)				-	string value
		DataPack (Datapack)			-	Nested DataPacks

		These may or may not be supported in the future:
		object (Object)				-	Object instance (untyped)
		typed (TObject)				-	Typed object instance

		Note that all array types above are indexed. Iterator and / or Collection support may be added at a later date.
		Note also that Object types may need to have their size also specified when they are created.

	DataItem Class Fields:

		Type		Enum
		Size		Int
		Code		String
		Name		String
		Value		Any of the Data Class supported types

	Header Class Fields:
		
		HeaderSize		Int
		HeaderSlot		Int
		ID					Long
		IndexSize		Int
		DataSize			Long
		ItemCount		Int
		Users				Int		(The number of Servers and Clients currently accessing this DataShare)
		DateStamp		Long		(THe datestamp of when it was last created / updated)
		Dirty				Bool		(Has this DataShare been changed since it was posted?)
		Locked			Bool		(Can this DataShare be written to or is it currently locked by a process?)
		ReadOnly			Bool		(Is this DataShare read only?)
		Private			Bool		(Default to false)
		Name				String	(The name of the DataShare entry)
		Owner / Group	String	(Owner = Server or Client or User. Required if marked private)
		
	HeaderList		Header		All the Data Share Headers in their own Memory Map.

	Index Class Fields:

		Next				int		(The start of the next Index entry)
		Index				int		(The Index of the Data Item)
		Type				DataType	(The Data Type of the Data Item)
		Offset			Long		(The offset of the Data in the Data Area - in bytes)
		Name				String	(If the Data Item has one)

	Global Class Fields:

		LastID			long		The last ID used. Incremented with each new Data Share.
		Count				int		The number of Headers / Data Stores currently available.
		HeaderSize		int		The total size of all the Headers.
		FreeSpace		int		The amount of free space available for more Headers.
		Locked			bool		Headers are being updated and temporarily locked.

	Passwords		String	How we are going to handle passwords and security in general I have no idea as yet

Ideas for the Future:

	Implement an optional Code (string) field in each Data Item for use in defining sections, codes, maintenance instructions and anything else the user desires.
	Use Named Pipes to alert Clients when a DataShare they might be interested in is available and the Client to mark when it has been read.
	Create Client and Server Library Interface classes for non OOP programs use?
